package com.flashextended.apps.logomaker.beans.workareaobjects
{
	import flash.display.Bitmap;
	import flash.display.Loader;
	import flash.display.Sprite;
	import flash.geom.ColorTransform;
	
	import mx.events.ResizeEvent;
	
	public class SymbolOnStage extends GenericObject
	{
		public static const TYPE:String = "SYMBOL";
		public static var countSymbol:int = 0;
		private var loader:Bitmap;
		
		public function SymbolOnStage(l:Bitmap)
		{
			super();
			this.loaderContent = l;
			this.loaderContent.smoothing = true;
			this.type = TYPE;
			SymbolOnStage.countSymbol++;
			idImage = "symbol"+SymbolOnStage.countSymbol+".png";
		}
		
		public function set loaderContent(val:Bitmap):void
		{
			loader = val;
			this.addChild(loader);
			this.objectWidth = loader.width;
			this.objectHeight = loader.height;
		}
		public function get loaderContent():Bitmap
		{
			return loader;
		}
		
		private var _symbolColor:uint=0x000000;
		public function set symbolColor(val:uint):void
		{
			_symbolColor = val;
			var colorInfo:ColorTransform = loader.transform.colorTransform;
			colorInfo.color = _symbolColor;
			loader.transform.colorTransform = colorInfo;
		}
		public function get symbolColor():uint
		{
			return _symbolColor;
		}
		
		//setter and getter id image
		public function get idImage():String {
			return _idImage;
		}
		public function set idImage(o:String):void {
			_idImage = o;
		}
		protected var _idImage:String;		
		
		//BEGIN OPERATIONS
		override protected function moveX():void
		{
			
		}
		override protected function moveY():void
		{
			
		}
		override protected function changeW():void
		{
			this.width = objectWidth;
		}
		override protected function changeH():void
		{
			this.height = objectHeight;
		}
		override protected function resizeContainer(e:ResizeEvent):void
		{
			objectX = this.x;
			objectY = this.y;
			objectRotation = this.rotation;
			objectWidth = this.width;
			objectHeight = this.height;
			loader.width = objectWidth;
			loader.height = objectHeight;
		}			
		
	}
}